package com.gxa.jd.es;

import lombok.Data;
import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;

import javax.persistence.Id;
import java.util.Date;

@Document(indexName = "lq", type = "es_hotel", shards = 3, replicas = 0)
@Data
public class EsHotel {

    @Id
    private Integer id;//id

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;//酒店名字

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String address;//酒店地址

    @Field(index = false, type = FieldType.Keyword)
    private String images;//图片列表

    @Field(index = false, type = FieldType.Keyword)
    private String introduction;//酒店介绍

    @Field(type = FieldType.Keyword)
    private Integer status;//审核状态

    @Field(type = FieldType.Keyword)
    private Date revisionTime;//修改时间

    @Field(type = FieldType.Keyword)
    private Date creationTime;//创建时间

    //地理位置搜索
    @GeoPointField
    private GeoPoint geo;


}
